package com.jphoebe.plugin.mybatis.utils.jetbrain;

import com.intellij.openapi.util.IconLoader;
import com.jphoebe.plugin.mybatis.bean.icon.JavaMapperIcon;

import javax.swing.*;

/**
 * IconsUtil class
 *
 * @author 蒋时华
 * @date 2019/2/19
 */
public class IconsUtil {

    public static final Integer JAVA_MAPPER_NAVI_ICON_1 = 0;
    public static final Integer JAVA_MAPPER_NAVI_ICON_2 = 1;
    public static final Integer JAVA_MAPPER_NAVI_ICON_3 = 2;

    public static JavaMapperIcon getJavaMapperIcon(Integer iconType){
        if(IconsUtil.JAVA_MAPPER_NAVI_ICON_1.equals(iconType)){
            return new JavaMapperIcon(IconLoader.getIcon("/images/navi/toXml/to1.png"), IconLoader.getIcon("/images/navi/toJava/back1.png"));
        }else if(IconsUtil.JAVA_MAPPER_NAVI_ICON_2.equals(iconType)){
            return new JavaMapperIcon(IconLoader.getIcon("/images/navi/toXml/to2.png"), IconLoader.getIcon("/images/navi/toJava/back2.png"));
        }else if(IconsUtil.JAVA_MAPPER_NAVI_ICON_3.equals(iconType)){
            return new JavaMapperIcon(IconLoader.getIcon("/images/navi/toXml/to3.png"), IconLoader.getIcon("/images/navi/toJava/back3.png"));
        }
        return null;
    }

    public static Icon getSpringInjectionIcon(){
        return IconLoader.getIcon("/images/springInjection.png");
    }

    public static Icon getMybatisLogoIcon(){
        return IconLoader.getIcon("/images/logo/logo.png");
    }

}
